class Solution {
public:
    bool CheckPermutation(string s1, string s2) {
        if(s1.size()!=s2.size()) return false;
        unordered_map<char,int> hash1;
        for(int i=0;i<s1.size();++i)
        {
            hash1[s1[i]]++;
        }
        for(int i=0;i<s1.size();++i)
        {
            if((--hash1[s2[i]])<0) return false;
        }
        return true;
    }
};
